package cn.chainco.cts.jdo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

//工作单委托项目
@Entity
@Table(name = "cts_workitem")
public class WorkItem implements Serializable {
	private static final long serialVersionUID = -872914352261208659L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "workId")
	private Work work; // 工作单id

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "itemId")
	private Item item; // 委托项目id

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "serviceId")
	private Employee service; // 服务商

	@Temporal(TemporalType.TIMESTAMP)
	private Date startTime; // 开始时间

	@Temporal(TemporalType.TIMESTAMP)
	private Date endTime; // 完成时间

	@Column(length = 100)
	private String serviceRequest; // 项目要求

	@Column(length = 100)
	private String serviceFeedback; // 项目反馈

	@Column(nullable = false)
	private Integer type = 1; // 1.出发地ORG，2.装货港POL，3.卸货港POD，4.目的地DES
	
	@Column(nullable = false)
	private Integer status = 0; // 0.正常，1.暂停

	@Transient
	private Integer option1; // 可选临时字段

	@Transient
	private String option2; // 可选临时字段

	@Transient
	private String option3; // 可选临时字段

	@Transient
	private String option4; // 可选临时字段

	@Transient
	private String option5; // 可选临时字段

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Work getWork() {
		return work;
	}

	public void setWork(Work work) {
		this.work = work;
	}

	public Item getItem() {
		return item;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	public Employee getService() {
		return service;
	}

	public void setService(Employee service) {
		this.service = service;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public String getServiceRequest() {
		return serviceRequest;
	}

	public void setServiceRequest(String serviceRequest) {
		this.serviceRequest = serviceRequest;
	}

	public String getServiceFeedback() {
		return serviceFeedback;
	}

	public void setServiceFeedback(String serviceFeedback) {
		this.serviceFeedback = serviceFeedback;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getOption1() {
		return option1;
	}

	public void setOption1(Integer option1) {
		this.option1 = option1;
	}

	public String getOption2() {
		return option2;
	}

	public void setOption2(String option2) {
		this.option2 = option2;
	}

	public String getOption3() {
		return option3;
	}

	public void setOption3(String option3) {
		this.option3 = option3;
	}

	public String getOption4() {
		return option4;
	}

	public void setOption4(String option4) {
		this.option4 = option4;
	}

	public String getOption5() {
		return option5;
	}

	public void setOption5(String option5) {
		this.option5 = option5;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
}
